package com.hue.entity.excel;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.ArrayList;
import java.util.List;

/*
    返回所有课程分了的树形结构
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class TreeData {
    //id
    private String id;
    //分类名
    private String label;
    //孩子节点
    private List<TreeData> children;

    public void add(TreeData treeData){
        if(children==null){
            children = new ArrayList<>();
        }
        children.add(treeData);
    }
}
